<%--
  Created by IntelliJ IDEA.
  User: dailyblue
  Date: 2023/4/2
  Time: 10:19
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" isELIgnored="false" language="java" %>
<html>
<head>
    <title>EL容器操作</title>
</head>
<body>
<%
    pageContext.setAttribute("A", "aaa1", 1); // page容器 只能在当前页面使用
    pageContext.setAttribute("A", "aaa2", 2); // request ===request.setAttribute("A","aaa");
    pageContext.setAttribute("A", "aaa3", 3); // session
    pageContext.setAttribute("A", "aaa4", 4); // application

    Object obj1 = pageContext.getAttribute("A");
    Object obj2 = pageContext.getAttribute("A", 2);
    Object obj3 = pageContext.getAttribute("A", 3);
    Object obj4 = pageContext.getAttribute("A", 4);

    out.print("obj1: " + obj1 + "<br/>");
    out.print("obj2: " + obj2 + "<br/>");
    out.print("obj3: " + obj3 + "<br/>");
    out.print("obj4: " + obj4 + "<br/>");
%>
<hr/>
page:${pageScope.A}<br/>
request:${requestScope.A}<br/>
session:${sessionScope.A}<br/>
application:${applicationScope.A}<br/>
缩写方式：${A}
</body>
</html>
